<template>
  <div>

    <el-table
    :data="tableData"
    style="width: 100%">
    <el-table-column label="学号" width="180">
        <template slot-scope="scope">
          <div slot="reference" class="name-wrapper">
            <el-tag size="medium">{{ scope.row.number }}</el-tag>
          </div>
        </template>
      </el-table-column>
 <el-table-column
      label="姓名"
      width="180">
      <template slot-scope="scope">  
          <div slot="reference" class="name-wrapper">
            <el-tag size="medium">{{ scope.row.name }}</el-tag>
          </div>    
      </template>
    </el-table-column>


  <el-table-column label="科目" width="180">
        <template slot-scope="scope">
          <div slot="reference" class="name-wrapper">
            <el-tag size="medium">{{ scope.row.subject }}</el-tag>
          </div>
        </template>
      </el-table-column>
    <el-table-column label="试卷类型" width="180">
        <template slot-scope="scope">
          <div slot="reference" class="name-wrapper">
            <el-tag size="medium">{{ scope.row.type }}</el-tag>
          </div>
        </template>
      </el-table-column>
       <el-table-column label="发布时间" width="180">
        <template slot-scope="scope">  
            <el-tag size="medium">{{ scope.row.date }}</el-tag> 
        </template>
      </el-table-column>
    <el-table-column label="状态" width="180">
        <template slot-scope="scope">
          <div slot="reference" class="name-wrapper">
            <el-tag size="medium">{{ scope.row.state }}</el-tag>
          </div>
        </template>
      </el-table-column>

   
    <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button
          size="mini"
          @click="handleEdit( scope.row.id)">批改</el-button>
        
      </template>
    </el-table-column>
  </el-table>
 
  </div>
</template>
<script>
export default {
  data() {
    return {
       tableData: [
       ]
    };
  },
  methods: {
     handleEdit( id) {     
  
         this.$store.commit("setConpletedid",id)
        this.$router.push( '/teacher/paper_reviews/correctpaper')
      //  this.$router.push({ path: '',
      //    params: {tid : id} })
      },
    findhomework() {
      this.$axios
        .get(
          "http://localhost:8080/findAll_paper",
          //get请求参数
          
          {params:{userid:this.$store.state.userid}}
        )
        .then((resp) => {
        //console.log(resp.data)
        
          this.tableData=resp.data
        // console.log(this.tableData)
        });
    },
   
  },
   created(){
      this.findhomework();
    }
};
</script>
<style scoped></style>
